<?php

declare(strict_types=1);
/**
 * @Created by PhpStorm
 * @User    : 清风醉
 */
return [
    'default' => 'cos',
    'storage' => [
        'local'        => [
            'driver' => \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class,
            'root'   => __DIR__ . '/../../runtime',
        ],
        'local_public' => [
            'driver' => \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class,
            'root'   => __DIR__ . '/../../storage/public',
        ],
        'ftp'          => [
            'driver'   => \Hyperf\Filesystem\Adapter\FtpAdapterFactory::class,
            'host'     => 'ftp.example.com',
            'username' => 'username',
            'password' => 'password',
            // 'port' => 21,
            // 'root' => '/path/to/root',
            // 'passive' => true,
            // 'ssl' => true,
            // 'timeout' => 30,
            // 'ignorePassiveAddress' => false,
        ],
        'memory'       => [
            'driver' => \Hyperf\Filesystem\Adapter\MemoryAdapterFactory::class,
        ],
        's3'           => [
            'driver'                  => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class,
            'credentials'             => [
                'key'    => env('S3_KEY'),
                'secret' => env('S3_SECRET'),
            ],
            'region'                  => env('S3_REGION'),
            'version'                 => 'latest',
            'bucket_endpoint'         => false,
            'use_path_style_endpoint' => false,
            'endpoint'                => env('S3_ENDPOINT'),
            'bucket_name'             => env('S3_BUCKET'),
        ],
        'minio'        => [
            'driver'                  => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class,
            'credentials'             => [
                'key'    => env('S3_KEY'),
                'secret' => env('S3_SECRET'),
            ],
            'region'                  => env('S3_REGION'),
            'version'                 => 'latest',
            'bucket_endpoint'         => false,
            'use_path_style_endpoint' => true,
            'endpoint'                => env('S3_ENDPOINT'),
            'bucket_name'             => env('S3_BUCKET'),
        ],
        'oss'          => [
            'driver'       => \Hyperf\Filesystem\Adapter\AliyunOssAdapterFactory::class,
            'accessId'     => env('OSS_ACCESS_ID'),
            'accessSecret' => env('OSS_ACCESS_SECRET'),
            'bucket'       => env('OSS_BUCKET'),
            'endpoint'     => env('OSS_ENDPOINT'),
            'expire'       => (int) env('OSS_EXPIRE'),
            // 'timeout'        => 3600,
            // 'connectTimeout' => 10,
            // 'isCName'        => false,
            // 'token'          => '',
        ],
        'qiniu'        => [
            'driver'    => \Hyperf\Filesystem\Adapter\QiniuAdapterFactory::class,
            'accessKey' => env('QINIU_ACCESS_KEY'),
            'secretKey' => env('QINIU_SECRET_KEY'),
            'bucket'    => env('QINIU_BUCKET'),
            'domain'    => env('QINBIU_DOMAIN'),
        ],
        'cos'          => [
            'driver'        => \Hyperf\Filesystem\Adapter\CosAdapterFactory::class,
            'region'        => env('COS_REGION'),
            // overtrue/flysystem-cos ^2.0 配置如下
            'credentials'   => [
                'appId'     => env('COS_APPID'),
                'secretId'  => env('COS_SECRET_ID'),
                'secretKey' => env('COS_SECRET_KEY'),
            ],
            // overtrue/flysystem-cos ^3.0 配置如下
            'app_id'        => env('COS_APPID'),
            'secret_id'     => env('COS_SECRET_ID'),
            'secret_key'    => env('COS_SECRET_KEY'),
            // 可选，如果 bucket 为私有访问请打开此项
            // 'signed_url' => false,
            'bucket'        => env('COS_BUCKET'),
            'read_from_cdn' => false,
            // 'timeout'         => 60,
            // 'connect_timeout' => 60,
            // 'cdn'             => '',
            // 'scheme'          => 'https',
        ],
    ],
];
